<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>返回文档中表单的数目</title>
</head>

<body>
    <form name="Form1"></form>
    <form name="Form2"></form>
    <form></form>
    <p>表单数目:
        <script>
            document.write(document.forms.length);
        </script>
</body>

</html>